package com.niiwoo.civet.trade.enums;

import com.niiwoo.tripod.provider.exception.NoSuchEnumValueException;
import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 标的是否发布枚举
 * @author xueyuke
 * @since 2018-08-24
 */
@AllArgsConstructor
@Getter
public enum ProjectIsPublishEnum {

    NO((byte)0,"未发布"),
    YES((byte)1,"已发布");

    private Byte value;
    private String name;


    public static ProjectIsPublishEnum enumOf(byte value) {
        for (ProjectIsPublishEnum projectIsPublishEnum : values()) {
            if (projectIsPublishEnum.value.equals(value)) {
                return projectIsPublishEnum;
            }
        }

        throw new NoSuchEnumValueException("ProjectIsPublishEnum:" + value);
    }
}
